#include<stdio.h>
#include<iostream>
#include<string>
using namespace std;
int main()
{
	int n,i;
	string s1,s2;
	cin>>n;
	for(i=0;i<n;i++){
		cin>>s1>>s2;
		if(s1.find(s2)!=-1) cout<<s1.find(s2)<<endl;
		else cout<<"not find"<<endl;
	}
	return 0;
}
